import { DataTypes } from 'sequelize';

export default function initDefaultAvatarModel(sequelize) {
  const DefaultAvatar = sequelize.define('DefaultAvatar', {
    id: {
      type: DataTypes.INTEGER,
      primaryKey: true,
      autoIncrement: true
    },
    name: {
      type: DataTypes.STRING(50),
      allowNull: false,
      comment: '头像名称'
    },
    url: {
      type: DataTypes.STRING(255),
      allowNull: false,
      comment: '头像URL地址'
    },
    category: {
      type: DataTypes.ENUM('male', 'female', 'cartoon', 'other'),
      defaultValue: 'other',
      comment: '头像分类：男性、女性、卡通、其他'
    },
    sort: {
      type: DataTypes.INTEGER,
      defaultValue: 0,
      comment: '排序号，数字越大越靠前'
    },
    status: {
      type: DataTypes.ENUM('active', 'inactive'),
      defaultValue: 'active',
      comment: '状态：活跃、非活跃'
    }
  }, {
    tableName: 'default_avatars',
    timestamps: true
  });

  return DefaultAvatar;
}
